<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of VMT_PlotXSCont</title>
  <meta name="keywords" content="VMT_PlotXSCont">
  <meta name="description" content="Plots contours for the variable 'var' within the mean cross section given">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2005 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">
  <script type="text/javascript">
    if (top.frames.length == 0) { top.location = "../index.html"; };
  </script>
</head>
<body>
<a name="_top"></a>
<!-- menu.html trunk -->
<h1>VMT_PlotXSCont
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>Plots contours for the variable 'var' within the mean cross section given</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function [z,A,V,zmin,zmax,log_text,fig_contour_handle] = VMT_PlotXSCont(z,A,V,var,exag,plot_english) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> Plots contours for the variable 'var' within the mean cross section given
 by the structure V. IF data is not supplied, user will be prompted to
 load data (browse to data).

 (adapted from code by J. Czuba)

 P.R. Jackson, USGS, 12-10-08 
 Last modified: F.L. Engel, USGS, 2/20/2013</pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="VMT_SelectFiles.html" class="code" title="function [zPathName,zFileName,zf] = VMT_SelectFiles;">VMT_SelectFiles</a>	Prompts the user to select preprocessed transect files output by</li></ul>
This function is called by:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="VMT.html" class="code" title="function varargout = VMT(varargin)">VMT</a>	--- THE VELOCITY MAPPING TOOLBOX ---</li><li><a href="VMT_PlotXSContQuiver.html" class="code" title="function [z,A,V,log_text] = VMT_PlotXSContQuiver(z,A,V,var,sf,exag,qspchorz,qspcvert,secvecvar,vvelcomp,plot_english)">VMT_PlotXSContQuiver</a>	This function plots the the contour plot (mean XS) for the variable 'var'</li></ul>
<!-- crossreference -->



<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [z,A,V,zmin,zmax,log_text,fig_contour_handle] = VMT_PlotXSCont(z,A,V,var,exag,plot_english)</a>
0002 <span class="comment">% Plots contours for the variable 'var' within the mean cross section given</span>
0003 <span class="comment">% by the structure V. IF data is not supplied, user will be prompted to</span>
0004 <span class="comment">% load data (browse to data).</span>
0005 <span class="comment">%</span>
0006 <span class="comment">% (adapted from code by J. Czuba)</span>
0007 <span class="comment">%</span>
0008 <span class="comment">% P.R. Jackson, USGS, 12-10-08</span>
0009 <span class="comment">% Last modified: F.L. Engel, USGS, 2/20/2013</span>
0010 
0011 
0012 
0013 <span class="comment">%disp(['Plotting Mean Cross Section Contour Plot: ' var])</span>
0014 log_text = {[<span class="string">'Plotting Mean Cross Section Contour Plot'</span>]};
0015 
0016 <span class="comment">%% User Input</span>
0017 
0018 <span class="comment">%exag=50;    %Vertical exaggeration</span>
0019 <span class="keyword">if</span> exist(<span class="string">'plot_english'</span>) == 0
0020     plot_english = 0;  <span class="comment">%plot english units (else metric)</span>
0021     disp(<span class="string">'No units specified, plotting in metric units by default'</span>)
0022 <span class="keyword">end</span>
0023 
0024 <span class="comment">%% Load the data if not supplied</span>
0025 <span class="keyword">if</span> isempty(z) &amp; isempty(A) &amp; isempty(V) 
0026     [zPathName,zFileName,zf] = <a href="VMT_SelectFiles.html" class="code" title="function [zPathName,zFileName,zf] = VMT_SelectFiles;">VMT_SelectFiles</a>;  <span class="comment">%Have the user select the preprocessed input files</span>
0027     eval([<span class="string">'load '</span> zPathName <span class="string">'\'</span> zFileName{1}]);
0028 <span class="keyword">end</span>
0029 
0030 
0031 <span class="comment">%% Plot contours</span>
0032 
0033 <span class="comment">% See if PLOT 3 exists already, if so clear the figure</span>
0034 fig_contour_handle = findobj(0,<span class="string">'name'</span>,<span class="string">'Mean Cross Section Contour'</span>);
0035 
0036 <span class="keyword">if</span> ~isempty(fig_contour_handle) &amp;&amp;  ishandle(fig_contour_handle)
0037     figure(fig_contour_handle); clf
0038 <span class="keyword">else</span>
0039     fig_contour_handle = figure(<span class="string">'name'</span>,<span class="string">'Mean Cross Section Contour'</span>); clf
0040     <span class="comment">%set(gca,'DataAspectRatio',[1 1 1],'PlotBoxAspectRatio',[1 1 1])</span>
0041 <span class="keyword">end</span>
0042 
0043 <span class="comment">% Turn off the menu bar, and keep only specified tools</span>
0044 disableMenuBar(fig_contour_handle)
0045 
0046 clvls = 60;
0047 
0048 <span class="comment">%Find the direction of primary discharge (flip if necessary)</span>
0049 binwidth  = diff(V.mcsDist,1,2);
0050 binwidth  = horzcat(binwidth(:,1), binwidth);
0051 binheight = diff(V.mcsDepth,1,1);
0052 binheight = vertcat(binheight, binheight(1,:));
0053 flux = nansum(nansum(V.u./100.*binwidth.*binheight)); <span class="comment">%Not a true measured discharge because of averaging, smoothing, edges, etc. but close</span>
0054 
0055 <span class="comment">% if zerosecq</span>
0056 <span class="comment">%     pdmin = nanmin(nanmin(V.vp));</span>
0057 <span class="comment">%     pdmax = nanmax(nanmax(V.vp));</span>
0058 <span class="comment">% else</span>
0059 <span class="comment">%     pdmin = nanmin(nanmin(V.u));</span>
0060 <span class="comment">%     pdmax = nanmax(nanmax(V.u));</span>
0061 <span class="comment">% end</span>
0062 <span class="keyword">if</span> flux &lt; 0; <span class="comment">%abs(pdmin) &gt; abs(pdmax)</span>
0063     flipxs = 1;
0064 <span class="keyword">else</span>
0065     flipxs = 0;
0066 <span class="keyword">end</span>
0067 
0068 <span class="keyword">if</span> flipxs 
0069     <span class="comment">%disp(['Streamwise Flow Direction (Normal to mean XS; deg) = ' num2str(V.phi - 180)])</span>
0070     <span class="comment">%disp(['Primary Flow Direction (deg) = ' num2str(V.phisp - 180)])</span>
0071     msg_str_1 = {[<span class="string">'   Streamwise Flow Direction (Normal to mean XS; deg) = '</span> num2str(V.phi - 180)];<span class="keyword">...</span>
0072         [<span class="string">'   Primary Flow Direction (deg) = '</span> num2str(V.phisp - 180)]};
0073 <span class="keyword">else</span>
0074     <span class="comment">%disp(['Streamwise Flow Direction (Normal to mean XS; deg) = ' num2str(V.phi)])</span>
0075     <span class="comment">%disp(['Primary Flow Direction (deg) = ' num2str(V.phisp)])</span>
0076     msg_str_1 = {[<span class="string">'   Streamwise Flow Direction (Normal to mean XS; deg) = '</span> num2str(V.phi)];<span class="keyword">...</span>
0077         [<span class="string">'   Primary Flow Direction (deg) = '</span> num2str(V.phisp)]};
0078 <span class="keyword">end</span>
0079 <span class="comment">%disp(['Deviation from Streamwise Direction (deg) = ' num2str(V.alphasp)])</span>
0080 <span class="comment">%disp(['Horizontal Grid Node Spacing (m) = ' num2str(A(1).hgns)])</span>
0081 
0082 <span class="comment">%Display in message box for compiled version</span>
0083 msg_string = {[<span class="string">'   Deviation from Streamwise Direction (deg) = '</span> num2str(V.alphasp)];<span class="keyword">...</span>
0084     <span class="keyword">...</span><span class="comment">['   Horizontal Grid Node Spacing (m) = ' num2str(A(1).hgns)]...</span>
0085     };
0086 <span class="comment">%msgbox([msg_str_1, msg_string],'VMT Cross Section Characteristics','help','replace');</span>
0087 log_text = vertcat(log_text,msg_str_1,msg_string);
0088 
0089 <span class="keyword">switch</span> var
0090     <span class="keyword">case</span>{<span class="string">'streamwise'</span>}  <span class="comment">%Plots the streamwise velocity</span>
0091         <span class="keyword">if</span> flipxs
0092             wtp=[<span class="string">'-V.uSmooth'</span>];
0093             zmin=floor(nanmin(nanmin(-V.uSmooth)));
0094             zmax=ceil(nanmax(nanmax(-V.uSmooth)));
0095         <span class="keyword">else</span>
0096             wtp=[<span class="string">'V.uSmooth'</span>];
0097             zmin=floor(nanmin(nanmin(V.uSmooth)));
0098             zmax=ceil(nanmax(nanmax(V.uSmooth)));
0099         <span class="keyword">end</span>
0100         zinc = (zmax - zmin) / clvls;
0101         zlevs = zmin:zinc:zmax;     
0102     <span class="keyword">case</span>{<span class="string">'transverse'</span>} <span class="comment">%Plots the transverse velocity</span>
0103         wtp=[<span class="string">'V.vSmooth'</span>];
0104         zmax=ceil(max(abs(nanmin(nanmin(V.vSmooth))),abs(nanmax(nanmax(V.vSmooth)))));
0105         zmin=-zmax;
0106         zinc = (zmax - zmin) / clvls;
0107         zlevs = zmin:zinc:zmax;
0108     <span class="keyword">case</span>{<span class="string">'vertical'</span>} <span class="comment">%Plots the vertical velocity</span>
0109         wtp=[<span class="string">'V.wSmooth'</span>];
0110         zmax=ceil(max(abs(nanmin(nanmin(V.wSmooth))),abs(nanmax(nanmax(V.wSmooth)))));
0111         zmin=-zmax;
0112         zinc = (zmax - zmin) / clvls;
0113         zlevs = zmin:zinc:zmax;
0114     <span class="keyword">case</span>{<span class="string">'mag'</span>} <span class="comment">%Plots the velocity magnitude</span>
0115         wtp=[<span class="string">'V.mcsMagSmooth'</span>];
0116         zmin=floor(nanmin(nanmin(V.mcsMagSmooth)));
0117         zmax=ceil(nanmax(nanmax(V.mcsMagSmooth)));
0118         zinc = (zmax - zmin) / clvls;
0119         zlevs = zmin:zinc:zmax;
0120     <span class="keyword">case</span>{<span class="string">'primary_zsd'</span>}  <span class="comment">%Plots the primary velocity with zero secondary discharge definition</span>
0121         <span class="keyword">if</span> flipxs
0122             wtp=[<span class="string">'-V.vpSmooth'</span>];
0123             zmin=floor(nanmin(nanmin(-V.vpSmooth)));
0124             zmax=ceil(nanmax(nanmax(-V.vpSmooth)));
0125         <span class="keyword">else</span>
0126             wtp=[<span class="string">'V.vpSmooth'</span>];
0127             zmin=floor(nanmin(nanmin(V.vpSmooth)));
0128             zmax=ceil(nanmax(nanmax(V.vpSmooth)));
0129         <span class="keyword">end</span>
0130         zinc = (zmax - zmin) / clvls;
0131         zlevs = zmin:zinc:zmax;                  
0132     <span class="keyword">case</span>{<span class="string">'secondary_zsd'</span>} <span class="comment">%Plots the secondary velocity with zero secondary discharge definition</span>
0133         wtp=[<span class="string">'V.vsSmooth'</span>];
0134         zmax=ceil(max(abs(nanmin(nanmin(V.vsSmooth))),abs(nanmax(nanmax(V.vsSmooth)))));
0135         zmin=-zmax;
0136         zinc = (zmax - zmin) / clvls;
0137         zlevs = zmin:zinc:zmax;
0138     <span class="keyword">case</span>{<span class="string">'primary_roz'</span>}  <span class="comment">%Plots the primary velocity with Rozovskii definition</span>
0139 <span class="comment">%         wtp=['V.Roz.upSmooth'];</span>
0140 <span class="comment">%         zmin=floor(nanmin(nanmin(V.Roz.upSmooth)));</span>
0141 <span class="comment">%         zmax=ceil(nanmax(nanmax(V.Roz.upSmooth)));</span>
0142         
0143         <span class="keyword">if</span> flipxs
0144             wtp=[<span class="string">'-V.Roz.upSmooth'</span>];  
0145             zmin=floor(nanmin(nanmin(-V.Roz.upSmooth)));
0146             zmax=ceil(nanmax(nanmax(-V.Roz.upSmooth)));
0147         <span class="keyword">else</span>
0148             wtp=[<span class="string">'V.Roz.upSmooth'</span>];
0149             zmin=floor(nanmin(nanmin(V.Roz.upSmooth)));
0150             zmax=ceil(nanmax(nanmax(V.Roz.upSmooth)));
0151         <span class="keyword">end</span>
0152         zinc = (zmax - zmin) / clvls;
0153         zlevs = zmin:zinc:zmax;                
0154     <span class="keyword">case</span>{<span class="string">'secondary_roz'</span>} <span class="comment">%Plots the secondary velocity with Rozovskii definition</span>
0155         wtp=[<span class="string">'V.Roz.usSmooth'</span>];
0156         zmax=ceil(max(abs(nanmin(nanmin(V.Roz.usSmooth))),abs(nanmax(nanmax(V.Roz.usSmooth)))));
0157         zmin=-zmax;
0158         zinc = (zmax - zmin) / clvls;
0159         zlevs = zmin:zinc:zmax;
0160     <span class="keyword">case</span>{<span class="string">'primary_roz_x'</span>}  <span class="comment">%Plots the primary velocity with Rozovskii definition (downstream component)</span>
0161 <span class="comment">%         wtp=['V.Roz.upxSmooth'];</span>
0162 <span class="comment">%         zmin=floor(nanmin(nanmin(V.Roz.upxSmooth)));</span>
0163 <span class="comment">%         zmax=ceil(nanmax(nanmax(V.Roz.upxSmooth)));</span>
0164       
0165         <span class="keyword">if</span> flipxs
0166             wtp=[<span class="string">'-V.Roz.upxSmooth'</span>];  
0167             zmin=floor(nanmin(nanmin(-V.Roz.upxSmooth)));
0168             zmax=ceil(nanmax(nanmax(-V.Roz.upxSmooth)));
0169         <span class="keyword">else</span>
0170             wtp=[<span class="string">'V.Roz.upxSmooth'</span>];
0171             zmin=floor(nanmin(nanmin(V.Roz.upxSmooth)));
0172             zmax=ceil(nanmax(nanmax(V.Roz.upxSmooth)));
0173         <span class="keyword">end</span>
0174         zinc = (zmax - zmin) / clvls;
0175         zlevs = zmin:zinc:zmax; 
0176     <span class="keyword">case</span>{<span class="string">'primary_roz_y'</span>}  <span class="comment">%Plots the primary velocity with Rozovskii definition (cross-stream component)</span>
0177         wtp=[<span class="string">'V.Roz.upySmooth'</span>];
0178         zmin=floor(nanmin(nanmin(V.Roz.upySmooth)));
0179         zmax=ceil(nanmax(nanmax(V.Roz.upySmooth)));
0180             
0181 <span class="comment">%         if flipxs</span>
0182 <span class="comment">%             wtp=['-V.Roz.upySmooth'];</span>
0183 <span class="comment">%             zmin=floor(nanmin(nanmin(-V.Roz.upySmooth)));</span>
0184 <span class="comment">%             zmax=ceil(nanmax(nanmax(-V.Roz.upySmooth)));</span>
0185 <span class="comment">%         else</span>
0186 <span class="comment">%             wtp=['V.Roz.upySmooth'];</span>
0187 <span class="comment">%             zmin=floor(nanmin(nanmin(V.Roz.upySmooth)));</span>
0188 <span class="comment">%             zmax=ceil(nanmax(nanmax(V.Roz.upySmooth)));</span>
0189 <span class="comment">%         end</span>
0190         zinc = (zmax - zmin) / clvls;
0191         zlevs = zmin:zinc:zmax;
0192     <span class="keyword">case</span>{<span class="string">'secondary_roz_x'</span>} <span class="comment">%Plots the secondary velocity with Rozovskii definition (downstream component)</span>
0193         wtp=[<span class="string">'V.Roz.usxSmooth'</span>];
0194         zmax=ceil(max(abs(nanmin(nanmin(V.Roz.usxSmooth))),abs(nanmax(nanmax(V.Roz.usxSmooth)))));
0195         zmin=-zmax;
0196         zinc = (zmax - zmin) / clvls;
0197         zlevs = zmin:zinc:zmax;
0198     <span class="keyword">case</span>{<span class="string">'secondary_roz_y'</span>} <span class="comment">%Plots the secondary velocity with Rozovskii definition (cross-stream component)</span>
0199         wtp=[<span class="string">'V.Roz.usySmooth'</span>];
0200         zmax=ceil(max(abs(nanmin(nanmin(V.Roz.usySmooth))),abs(nanmax(nanmax(V.Roz.usySmooth)))));
0201         zmin=-zmax;
0202         zinc = (zmax - zmin) / clvls;
0203         zlevs = zmin:zinc:zmax;        
0204     <span class="keyword">case</span>{<span class="string">'backscatter'</span>} <span class="comment">%Plots the backscatter</span>
0205         wtp=[<span class="string">'V.mcsBackSmooth'</span>];
0206         zmin=floor(nanmin(nanmin(V.mcsBackSmooth)));
0207         zmax=ceil(nanmax(nanmax(V.mcsBackSmooth)));
0208         zinc = (zmax - zmin) / clvls;
0209         zlevs = zmin:zinc:zmax;
0210     <span class="keyword">case</span>{<span class="string">'flowangle'</span>} <span class="comment">%Plots the flow direction (N = 0.0 deg)</span>
0211         wtp=[<span class="string">'V.mcsDirSmooth'</span>];
0212         zmin=floor(nanmin(nanmin(V.mcsDirSmooth)));
0213         zmax=ceil(nanmax(nanmax(V.mcsDirSmooth)));
0214         zinc = (zmax - zmin) / clvls;
0215         zlevs = zmin:zinc:zmax;
0216     <span class="keyword">case</span>{<span class="string">'vorticity_vw'</span>} 
0217         wtp=[<span class="string">'V.vorticity_vw'</span>];
0218         zmin=floor(nanmin(V.vorticity_vw(:)));
0219         zmax=ceil(nanmax(V.vorticity_vw(:)));
0220         zinc = (zmax - zmin) / clvls;
0221         zlevs = zmin:zinc:zmax;
0222     <span class="keyword">case</span>{<span class="string">'vorticity_zsd'</span>}
0223         wtp=[<span class="string">'V.vorticity_zsd'</span>];
0224         zmin=floor(nanmin(V.vorticity_zsd(:)));
0225         zmax=ceil(nanmax(V.vorticity_zsd(:)));
0226         zinc = (zmax - zmin) / clvls;
0227         zlevs = zmin:zinc:zmax;
0228     <span class="keyword">case</span>{<span class="string">'vorticity_roz'</span>} 
0229         wtp=[<span class="string">'V.vorticity_roz'</span>];
0230         zmin = floor(nanmin(V.vorticity_roz(:)));
0231         zmax = ceil(nanmax(V.vorticity_roz(:)));
0232         zinc = (zmax - zmin) / clvls;
0233         zlevs = zmin:zinc:zmax;
0234 
0235 <span class="comment">%     case{'dirdevp'} %Plots the directional deviation from the primary velocity</span>
0236 <span class="comment">%         wtp=['V.mcsDirDevp'];</span>
0237 <span class="comment">%         %zmax=ceil(max(abs(nanmin(nanmin(V.mcsDirDevp))),abs(nanmax(nanmax(V.mcsDirDevp)))));</span>
0238 <span class="comment">%         %zmin=-zmax;</span>
0239 <span class="comment">%         zmin=floor(nanmin(nanmin(V.mcsDirDevp)));</span>
0240 <span class="comment">%         zmax=ceil(nanmax(nanmax(V.mcsDirDevp)));</span>
0241 <span class="comment">%         zinc = (zmax - zmin) / clvls;</span>
0242 <span class="comment">%         zlevs = zmin:zinc:zmax;</span>
0243 <span class="keyword">end</span>
0244 
0245 
0246 figure(fig_contour_handle); hold all
0247 <span class="keyword">if</span> plot_english
0248     convfact = 0.03281; <span class="comment">%cm/s to ft/s</span>
0249     <span class="keyword">switch</span> var
0250         <span class="keyword">case</span>{<span class="string">'backscatter'</span>}
0251             convfact = 1.0; 
0252         <span class="keyword">case</span>{<span class="string">'flowangle'</span>}
0253             convfact = 1.0;
0254     <span class="keyword">end</span>
0255     contour_handle = pcolor(V.mcsDist*3.281,V.mcsDepth*3.281,eval(wtp)*convfact); hold on
0256     shading interp
0257 <span class="comment">%     contour(V.mcsDist*3.281,V.mcsDepth*3.281,eval(wtp)*convfact,zlevs*convfact,'Fill','on','Linestyle','none'); hold on  %wtp(1,:)</span>
0258     bed_handle = plot(V.mcsDist(1,:)*3.281,V.mcsBed*3.281,<span class="string">'w'</span>, <span class="string">'LineWidth'</span>,2); hold on
0259 <span class="keyword">else</span>
0260     contour_handle = pcolor(V.mcsDist,V.mcsDepth,eval(wtp)); hold on
0261     shading interp
0262 <span class="comment">%     contour(V.mcsDist,V.mcsDepth,eval(wtp),zlevs,'Fill','on','Linestyle','none'); hold on  %wtp(1,:)</span>
0263     bed_handle = plot(V.mcsDist(1,:),V.mcsBed,<span class="string">'w'</span>, <span class="string">'LineWidth'</span>,2); hold on
0264 <span class="keyword">end</span>
0265 
0266 
0267 
0268 <span class="comment">%Plot the grid node for a check</span>
0269 <span class="keyword">if</span> 0
0270     plot(V.mcsDist,V.mcsDepth,<span class="string">'k.'</span>,<span class="string">'MarkerSize'</span>,3); hold on
0271     [goodcellsx,goodcellsy] = find(isnan(eval(wtp)) == 0);
0272     plot(V.mcsDist(1,goodcellsy),V.mcsDepth(goodcellsx,1),<span class="string">'w.'</span>,<span class="string">'MarkerSize'</span>,3); hold on
0273 <span class="keyword">end</span>
0274 
0275 <span class="keyword">if</span> plot_english
0276     unitlabel = <span class="string">'(ft/s)'</span>;
0277 <span class="keyword">else</span>
0278     unitlabel = <span class="string">'(cm/s)'</span>;
0279 <span class="keyword">end</span>
0280 
0281 <span class="keyword">switch</span> var
0282     <span class="keyword">case</span>{<span class="string">'streamwise'</span>}
0283         title_handle = title([<span class="string">'Streamwise Velocity '</span> unitlabel]);
0284     <span class="keyword">case</span>{<span class="string">'transverse'</span>}
0285         title_handle = title([<span class="string">'Transverse Velocity '</span> unitlabel]);
0286     <span class="keyword">case</span>{<span class="string">'vertical'</span>}
0287         title_handle = title([<span class="string">'Vertical Velocity '</span> unitlabel]);
0288     <span class="keyword">case</span>{<span class="string">'mag'</span>}
0289         title_handle = title([<span class="string">'Velocity Magnitude (Streamwise and Transverse) '</span> unitlabel]);
0290     <span class="keyword">case</span>{<span class="string">'primary_zsd'</span>}
0291         title_handle = title([<span class="string">'Primary Velocity (Zero Secondary Discharge Definition) '</span> unitlabel]);
0292     <span class="keyword">case</span>{<span class="string">'secondary_zsd'</span>}
0293         title_handle = title([<span class="string">'Secondary Velocity (Zero Secondary Discharge Definition) '</span> unitlabel]);
0294     <span class="keyword">case</span>{<span class="string">'primary_roz'</span>}
0295         title_handle = title([<span class="string">'Primary Velocity (Rozovskii Definition) '</span> unitlabel]);
0296     <span class="keyword">case</span>{<span class="string">'secondary_roz'</span>}
0297         title_handle = title([<span class="string">'Secondary Velocity (Rozovskii Definition) '</span> unitlabel]); 
0298     <span class="keyword">case</span>{<span class="string">'primary_roz_x'</span>}
0299         title_handle = title([<span class="string">'Primary Velocity (Rozovskii Definition; Downstream Component) '</span> unitlabel]);    
0300     <span class="keyword">case</span>{<span class="string">'primary_roz_y'</span>}
0301         title_handle = title([<span class="string">'Primary Velocity (Rozovskii Definition; Cross-Stream Component) '</span> unitlabel]);        
0302     <span class="keyword">case</span>{<span class="string">'secondary_roz_x'</span>}
0303         title_handle = title([<span class="string">'Secondary Velocity (Rozovskii Definition; Downstream Component) '</span> unitlabel]);        
0304     <span class="keyword">case</span>{<span class="string">'secondary_roz_y'</span>}
0305         title_handle = title([<span class="string">'Secondary Velocity (Rozovskii Definition; Cross-Stream Component) '</span> unitlabel]);        
0306     <span class="keyword">case</span>{<span class="string">'backscatter'</span>}
0307         title_handle = title(<span class="string">'Backscatter Intensity (dB)'</span>);
0308     <span class="keyword">case</span>{<span class="string">'flowangle'</span>}
0309         title_handle = title(<span class="string">'Flow Direction (deg)'</span>);
0310     <span class="keyword">case</span>{<span class="string">'vorticity_vw'</span>}
0311         title_handle = title(<span class="string">'Streamwise Vorticity'</span>);
0312     <span class="keyword">case</span>{<span class="string">'vorticity_zsd'</span>}
0313         title_handle = title(<span class="string">'Streamwise Vorticity (Zero Secondary Discharge Definition)'</span>);
0314     <span class="keyword">case</span>{<span class="string">'vorticity_roz'</span>}
0315         title_handle = title(<span class="string">'Streamwise Vorticity (Rozovskii Definition)'</span>);
0316 <span class="comment">%     case{'dirdevp'}</span>
0317 <span class="comment">%         title('Deviation from Primary Flow Direction (deg)')</span>
0318 <span class="keyword">end</span>
0319 colorbar_handle = colorbar; hold all
0320 
0321 <span class="keyword">if</span> plot_english
0322     caxis([zmin*convfact zmax*convfact])
0323     xlim([nanmin(nanmin(V.mcsDist*3.281)) nanmax(nanmax(V.mcsDist*3.281))])
0324     ylim([0 max(V.mcsBed*3.281)])
0325     set(gca,<span class="string">'YDir'</span>,<span class="string">'reverse'</span>)
0326     <span class="keyword">if</span> flipxs
0327         set(gca,<span class="string">'XDir'</span>,<span class="string">'reverse'</span>)
0328     <span class="keyword">end</span>
0329     ylabel_handle = ylabel(<span class="string">'Depth (ft)'</span>);
0330     xlabel_handle = xlabel(<span class="string">'Distance (ft)'</span>);
0331 <span class="keyword">else</span>
0332     caxis([zmin zmax])
0333     xlim([nanmin(nanmin(V.mcsDist)) nanmax(nanmax(V.mcsDist))])
0334     ylim([0 max(V.mcsBed)])
0335     set(gca,<span class="string">'YDir'</span>,<span class="string">'reverse'</span>)
0336     <span class="keyword">if</span> flipxs
0337         set(gca,<span class="string">'XDir'</span>,<span class="string">'reverse'</span>)
0338     <span class="keyword">end</span>
0339     ylabel_handle = ylabel(<span class="string">'Depth (m)'</span>);
0340     xlabel_handle = xlabel(<span class="string">'Distance (m)'</span>);
0341 <span class="keyword">end</span>
0342 
0343 <span class="keyword">if</span> strcmp(var,<span class="string">'vorticity_vw'</span>)||strcmp(var,<span class="string">'vorticity_zsd'</span>)||strcmp(var,<span class="string">'vorticity_roz'</span>)
0344     rng = zmax - zmin;
0345     cmr = [linspace(0,1,25)'];
0346     cmr = [cmr; linspace(1,1,25)'];
0347     cmg = [linspace(0,1,25)'];
0348     cmg = [cmg; linspace(1,0,25)'];
0349     cmb = [linspace(1,1,25)'];
0350     cmb = [cmb; linspace(1,0,25)'];
0351     figure(3)
0352     colormap([cmr cmg cmb])
0353     caxis([-rng/2 rng/2])
0354 <span class="keyword">else</span>
0355     colormap jet
0356 <span class="keyword">end</span>
0357 
0358 <span class="comment">% Tag the elements in the figure</span>
0359 set(contour_handle,                 <span class="string">'Tag'</span>,<span class="string">'ContouredVelocities'</span>)
0360 set(bed_handle,                     <span class="string">'Tag'</span>,<span class="string">'PlotBedElevation'</span>)
0361 set(colorbar_handle,                <span class="string">'Tag'</span>,<span class="string">'ColorBar'</span>)
0362 set(title_handle,                   <span class="string">'Tag'</span>,<span class="string">'ContourPlotTitle'</span>)
0363 set(ylabel_handle,                  <span class="string">'Tag'</span>,<span class="string">'yLabelText'</span>)
0364 set(xlabel_handle,                  <span class="string">'Tag'</span>,<span class="string">'xLabelText'</span>)
0365 
0366 <span class="comment">% Adjust the plot</span>
0367 set(gca,<span class="keyword">...</span>
0368     <span class="string">'DataAspectRatio'</span>,   [exag 1 1],<span class="keyword">...</span>
0369     <span class="string">'PlotBoxAspectRatio'</span>,[exag 1 1]<span class="keyword">...</span>
0370     <span class="keyword">...</span><span class="comment">'FontSize',          14)</span>
0371     )
0372 <span class="comment">% set(get(gca,'Title'),   'FontSize',14,'Color','w')</span>
0373 <span class="comment">% set(get(gca,'xlabel'),  'FontSize',14,'Color','w')</span>
0374 <span class="comment">% set(get(gca,'ylabel'),  'FontSize',14,'Color','w')</span>
0375 <span class="comment">% set(gca,...</span>
0376 <span class="comment">%     'XColor','w',...</span>
0377 <span class="comment">%     'YColor','w',...</span>
0378 <span class="comment">%     'ZColor','w',...</span>
0379 <span class="comment">%     'Color',[0.3 0.3 0.3])</span>
0380 <span class="comment">% set(gcf,...</span>
0381 <span class="comment">%     'InvertHardCopy','off',...</span>
0382 <span class="comment">%     'Color','k')</span>
0383 <span class="comment">%figure('Name','Cross Section','NumberTitle','off')</span>
0384 <span class="comment">% scrsz = get(0,'ScreenSize');</span>
0385 <span class="comment">% figure('OuterPosition',[1 scrsz(4) scrsz(3) scrsz(4)])</span>
0386 
0387 <span class="comment">%figure(5); clf; compass(V.mcsEast,V.mcsNorth)</span>
0388</pre></div>
<hr><address>Generated on Tue 30-Apr-2013 10:18:12 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" target="_parent">m2html</a></strong> &copy; 2005</address>
</body>
</html>